#include <iostream>

using namespace std;

int main()
{
    long long int t;
    cin>>t;
    t /= 1000;
    t %= 60*60*24;
    int h = t/3600;
    t %= 3600;
    int m = t/60;
    int s = t%60;
    printf("%.2d:%.2d:%.2d",h ,m ,s);
    return 0;
}
